<%@page contentType="text/html;charset=UTF-8"%>
<%@include file="/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-cn">
  <head>
	<jsp:include page="/platform/include/page_edit_head.jsp">
		<jsp:param name="title" value="编辑" />
	</jsp:include>
	<link rel="stylesheet" href="${platform }/js/plugins/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
  </head>
  <body style="width:750px; overflow-x:hidden;" path="${path}">
    <!--主区域 -->
    <div class="main-container" id="mainContainer">
      <form  class="form-horizontal" role="_editForm form" action="ajax_edit" data-validate="true"  id="editForm" method="post" >
         <c:if test="${item.id > 0 }">
       		<input id="" name="id" type="hidden" value="${item.id }"/>
       		<input id="" name="createdate" type="hidden" value="${item.createdate }"/>
        </c:if> 
        <input type="hidden" name="acls" id="treenode" value="${item.acls}"/>
        <div class="main-contentWrap cm-f14">
          <table class="table">
            <tbody>
              <tr>
                <td class="col-xs-2 table-item">
                	<label class="cm-required">*</label>工作名称:</td>
                <td class="col-xs-8">
                  <input type="text" class="table-input cm-w200 {required:true}" name="jname" id="jname" value="${item.jname}"/>
                  <!-- <label class="cm-lh31 cm-f14 cm-f-normal">2-30个字符</label> -->
                </td>
              </tr>
              <tr>
                <td class="col-xs-2 table-item">
                	<label class="cm-required">*</label>权限:</td>
                <td class="col-xs-8">
                  <ul id="treeDemo" class="ztree"></ul>
                  <!-- <label class="cm-lh31 cm-f14 cm-f-normal">2-30个字符</label> -->
                </td>
              </tr>
              <tr>
                <td class="col-xs-2 table-item" >
                	<label class="cm-required">*</label>状态:</td>
                <td class="col-xs-8">
                  <select name="status" id="status" class="table-select cm-w200 {required:true}" type="_defaultData" data-defaultValue="${(null==item.status)?'':item.status}">
						<option value="">请选择状态</option>
						<c:forEach var="arrItem" items="${commArray.arr_Isforbid}" varStatus="idx" begin="1">
							<option value="${idx.index}">${arrItem}</option>
						</c:forEach>
				  </select>
                </td>
              </tr>
              <tr>
                <td class="col-xs-2 table-item">
                  <label class="cm-required">*</label>录入人:</td>
                <td class="col-xs-8">
                  <input type="text" class="table-input cm-w200 {required:true}" name="user" id="user" value="${sessionScope._user.account }" readonly="readonly"/>
                  <!-- <label class="cm-lh31 cm-f14 cm-f-normal">2-30个字符</label> -->
                </td>
              </tr>
              <c:if test="${item.id > 0 }">
              <tr>
                <td class="col-xs-2 table-item">创建时间:</td>
                <td class="col-xs-8">
                  <label class="cm-lh31 cm-f14 cm-f-normal cm-mg0">${item.createdate}</label>
                </td>
              </tr>
              <tr>
                <td class="col-xs-2 table-item">修改时间:</td>
                <td class="col-xs-8">
                  <label class="cm-lh31 cm-f14 cm-f-normal cm-mg0">${item.lastdate}</label>
                </td>
              </tr>
              </c:if>
              <tr>
                <td class="cm-tac" colspan="2" >
                  <!-- <a href="javascript:void(0);" class="cm-btn-default" >确定</a> -->
                  <input type="submit" class="cm-btn-default cm-border0" value="确定">
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <a href="javascript:window.Util.showBox.closeBox();" class="cm-btn-default" >取消</a>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </form>
    </div>
    <footer></footer>

    <jsp:include page="/platform/include/page_edit_footer.jsp"></jsp:include>
    <script type="text/javascript" src="${platform }/js/plugins/ztree/js/jquery.ztree.core-3.5.min.js"></script>
	<script type="text/javascript" src="${platform }/js/plugins/ztree/js/jquery.ztree.excheck-3.5.min.js"></script>
<script>
	var setting = {
			check: {
				enable: true
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			callback:{
				onCheck:function(event, treeId, treeNode){
					var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
					var nodes = treeObj.getCheckedNodes(true);
					var checkStr = [];
					$.each(nodes, function(key,value) {
					   if(value.id.length==6)checkStr.push(value.id)
		    		});
		    		$('#treenode').val(checkStr.toString());
				}
			}
		};

		var zNodes = ${zNodes};
    $(function(){
    	$.fn.zTree.init($("#treeDemo"), setting, zNodes);
    });
</script>
  </body>
</html>

